use strict;
use warnings;

my $regex='\s*(\-+[\w\-\+\=]+)\s*';

while(<>)
{

    if (/^\s*\-+/) # opt line
    {
	chomp;

	if (/^$regex$/)
	{
	    print "\n===OPT $1===\n";
	}
	elsif (/^$regex $regex$/)
	{
	    print "\n===OPT $1===\n";
	    print "===OPT $2===\n";
	}
	elsif (/$regex\(C\+\+ only\)\s*/)
	{
#	    warn "cpp \"$1\"";
	    print "\n===OPT $1===\n";
	}
	elsif (/^$regex \w+  .+/)
	{
	    
	}
	else
	{
	    warn "cannot parse \"$_\"";
	}
    }
    print $_;
}
